home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / DD3BETA1.ZIP / PACK1.PRG / TMP / DD3START.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1997-01-15  |  5.2 KB  |  154 lines

  1. unit dd3start;
  2.  
  3. (* Start Up Routines
  4.    1) Read GAME.CTL File
  5.    2) Read Drop File
  6.    3) Initialize CommPorts
  7.    4) Check for Any Errors
  8.    5)*Initialize Script Interpretor (Coming)
  9.    *)
  10.  
  11. interface
  12.  
  13. uses dd3res,dd3str,dd3graph,dd3comm,crt,dd3ini,dd3drop;
  14.  
  15.  
  16. procedure initdoordriver(filen : string);
  17. procedure checkparameters;
  18. procedure local_login;
  19. procedure readdropfiles;
  20. implementation
  21.  
  22. uses dd3;
  23.  
  24. procedure local_login;
  25. var
  26.  a,b: integer;
  27.  d: boolean;
  28.  s: string;
  29. begin;
  30.  clrscr;
  31.  writeln;
  32.  writeln('┌───────────────────────────────┐');
  33.  writeln('│          Local Logon          │');
  34.  writeln('└───────────────────────────────┘');
  35.  writeln;
  36.  writeln('Please enter your name below (or leave blank for '+sysop_first_name+' '+sysop_last_name+'):');
  37.  write('>');
  38.  readln(s);
  39.  if s= '' then begin;
  40.   user_first_name:=sysop_first_name;
  41.   user_last_name:=sysop_last_name;
  42.  end else begin;
  43.   user_first_name:=copy(s,1,pos(' ',s)-1);
  44.   user_last_name:=copy(s,pos(' ',s)+1,length(s));
  45.   end;
  46.  graphics:=ANSI;
  47.  bbs_time_left:=120;
  48.  user_access_level:=255;
  49. end;
  50. procedure showparameters;
  51. begin
  52. writeln(programname+' Command Line Parameters');
  53. writeln('');
  54. writeln('');
  55. writeln('/A             {Force ANSI Graphics Local Only}');
  56. writeln('/R             {Force RIP Graphics  Local Only}');
  57. writeln('/M             {Force MAX Graphics  Local Only}');
  58. writeln('/B<Lockedbaud> {Set the Locked BaudRate}');
  59. writeln('/C<comport>    {Set the ComPort}');
  60. writeln('/I<irq>        {Set the IRQ}');
  61. writeln('/F             {Set Comm Routines to Fossil}');
  62. writeln('/D<BBSType>    {Taken From DROPFILE.INI Headers}');
  63. writeln('/L             {Set to Local Login - Will Use DropFile if Found}');
  64. writeln('/N<Node>       {Set the Node Number}     ');
  65. writeln('/P<DropFile>   {Set the DropFile Path}');
  66. writeln('/K<CTLFile>    {Set the Control File}');
  67. writeln('/?             {Show this Screen}');
  68. halt;
  69. end;
  70.  
  71. procedure checkparameters;
  72. var i : byte;
  73. temp : string;
  74. begin
  75. for i := 1 to paramcount do
  76.   begin
  77.      temp := paramstr(i);
  78.      case upcase(temp[2]) of
  79.       'B' : lockedbaud := str_to_int(copy(temp,3,length(temp)));
  80.       'C' : com_port   := str_to_int(copy(temp,3,length(temp)));
  81.       'I' : nonsirq    := str_to_int(copy(temp,3,length(temp)));
  82.       'F' : asynctype  := fossil;
  83.       'L' : local      := true;
  84.       'N' : node_num   := str_to_int(copy(temp,3,length(temp)));
  85.       'R' : graphics   := RIP;
  86.       'M' : graphics   := MAX;
  87.       'P' : dropfilepath := copy(temp,3,length(temp));
  88.       'D' : bbstype      := copy(temp,3,length(temp));
  89.       'K' : ctlfile      := copy(temp,3,length(temp));
  90.       '?' : showparameters;
  91.    end;{Case}
  92.   end;{for}
  93.  
  94. if ctlfile = '' then ctlfile   := 'DOOR.CTL';
  95. if node_num = 0 then node_num := 1;
  96. end;
  97.  
  98. procedure initdoordriver(filen:string);
  99. begin
  100.  readall(filen);
  101.  dropfilepath     := resourcestring('DropFile',DropFilepath);
  102.  lockedbaud       := resourceinteger('LockedBaud',lockedbaud);
  103.  sysop_first_name := resourcestring('SysopFirst','Joe');
  104.  sysop_last_name  := resourcestring('SysopLast','Sysop');
  105.  BBSType          := resourcestring('BBSType',BBSType);
  106.  Com_port         := resourceinteger('ComPort',com_port);
  107.  UseFossil        := resourceboolean('Fossil',false);
  108.  NonSport         := resourcestring('Port','0');
  109.  NonSIRQ          := resourceinteger('Irq',nonsirq);
  110.  MaxTime          := resourceinteger('MaxTime',0);
  111.  board_name       := resourcestring('BBSName','Joes BBS!');
  112. if usefossil then
  113.   asynctype       := fossil;
  114. end;
  115.  
  116. procedure readdropfiles;
  117. var
  118.   temp : string;
  119.   ansic : boolean;
  120. begin
  121. if BBSType = '' then BBSType := 'DOORSYS';
  122. loadini('GDROP.INI');
  123. ReadDrop(DropFilePath+getentry(BBSType,'DosName','DOOR.SYS'));
  124. user_first_name            := dropstring(getentryi(BBSType,'FirstName',0));
  125. if getentryi(BBSType,'FirstName',0) = getentryi(BBSType,'LastName',0) then
  126.   begin
  127.    temp := user_first_name;
  128.    user_first_name         := copy(temp,1,pos(' ',temp)-1);
  129.    user_last_name          := copy(temp,pos(' ',temp)+1,length(temp));
  130.   end else user_last_name  := dropstring(getentryi(BBSType,'LastName',0));
  131. user_citystate             := dropstring(getentryi(BBSType,'CityState',0));
  132. baud_rate                  := dropinteger(getentryi(BBSType,'BaudRate',0));
  133. user_access_level          := dropinteger(getentryi(BBSType,'AccessLevel',0));
  134. ansic                       := dropboolean(getentryi(BBSType,'Ansi',0));
  135. bbs_time_left              := dropinteger(getentryi(BBSType,'MinutesLeft',0));
  136. IF (lockedbaud = 0) then
  137. lockedbaud                 := dropinteger(getentryi(BBSType,'LockedBaud',0));
  138. if (com_port = 0) and (BBSType <> 'DOORSYS') and (BBSType <> 'DORINFO')
  139.  then com_port := dropinteger(getentryi(BBSType,'ComPort',0))
  140.   else if (com_port = 0) then begin
  141.    temp                      := dropstring(getentryi(BBSType,'ComPort',0));
  142.    com_port                  := str_to_int(copy(temp,pos('M',temp)+1,1));
  143.   end;{else}
  144. if node_num = 0 then node_num := dropinteger(getentryi(BBSType,'Node',0));
  145. if (baud_rate = 0) or (com_port = 0) then local := true;
  146. if ansic = true then graphics := ANSI
  147.   else graphics := ASCII;
  148. end;
  149.  
  150. begin
  151. NonSIrq    := 0;
  152. lockedbaud := 0;
  153. NonSPort   := '$0000'
  154. end.